package com.aoyama.office.libreoffice.controller;


import com.aoyama.office.libreoffice.service.AttachementService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@Controller
@RequestMapping("/viewfile")
public class ViewPdfController {
    @Autowired
    private AttachementService attachmentsService;

    @RequestMapping(value = "/pdf", method = RequestMethod.GET)
//    @ResponseBody
    @Validated
    public void downloadFile(@RequestParam(value = "address") String address, HttpServletResponse response) throws Exception {
//        attachmentsService.libreOfficeOnlinePreview(address, response);
    }
}